<!DOCTYPE html>
<html>

<head>
<title>类别类型</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<%include("/common/include.html"){}%>
</head>

<body class="easyui-layout">
	<div data-options="region:'center',fit:false,border:false,split:false">
		<div id="contentLayout" class="easyui-layout" data-options="fit:true">
			<div id="table_div" data-options="region:'center',border: false">				
				 <div id="tb" style="height: auto;padding:5px;">
					<% if(authUrl("/propgandaThings/toAddProduct")){ %>
					<a href="#" onclick='addProduct()' class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
					<% } %>
					<a href="#" class="easyui-linkbutton" iconCls="icon-edit" onclick="editProduct()" plain="true">修改</a>
				</div>
				<table id="thingsTable" style="height:100%" ></table>
			</div>
		</div>
	</div>
	<script src="${cxt !}/sb/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
	function addProduct(){
		
			loadDialog($("#thingsTable"), null, '添加产品', 'propgandaThings/toAddProduct');
		
	}
	 function editProduct(){
		 var row = $("#thingsTable").datagrid('getSelected');
		 if(row == null){
			 $.slideMsg("请选中一条记录！", parent.$);
		 }else{
			 loadDialog($("#thingsTable"), null, '编辑产品', 'propgandaThings/toUpProduct?ids=' + row.ids);
		 }
	} 
$(document).ready(function () {
		
		initDeptTable();
		
	})
					function initDeptTable(){
		
		$("#thingsTable").datagrid({
			cls: "theme-datagrid",
			singleSelect: true,
			rownumbers: true, //显示序号
			pagination: false,
			//pageSize: 10,
			url:"propgandaThings/productList",
			queryParams :{
				
			},
			toolbar:'#tb',
		    method: 'post',
			collapsible: true,
			columns:[[
				  		{field:'ids',title:'ids',width:100,align:'center', hidden:true},
				  		{field:'probh',title:'编号',width:100,align:'center'},
				  		{field:'name',title:'名称',width:100, align:'center'},
				  		{field:'price',title:'单价',width:160, align:'center'},
				  		{field:'num',title:'数量',width:100, align:'center'},
				  		{field:'pricesum',title:'总额',width:100, align:'center'}
				      ]],
			onLoadSuccess:function(){
				
			}
			
		});
	  }
	
	</script>

</body>